package gemini.castor.ui.client.page.content.store.catalog.productcatalog;

import com.google.gwt.event.shared.GwtEvent;

public class ProductCatalogEvent extends GwtEvent<ProductCatalogHandler> {

	private static Type<ProductCatalogHandler> TYPE;
	
	public static Type<ProductCatalogHandler> getType() {
		if (TYPE == null)
			TYPE = new Type<ProductCatalogHandler>();
		return TYPE;
	}
	
	private String productTypeCode;
	
	public ProductCatalogEvent(String productTypeCode) {
		super();
		this.productTypeCode = productTypeCode;
	}

	@Override
	protected void dispatch(ProductCatalogHandler handler) {
		handler.onChangeProductType(this);
	}
	
	@Override
	public Type<ProductCatalogHandler> getAssociatedType() {
		return getType();
	}

	public String getProductTypeCode() {
		return productTypeCode;
	}
}
